package com.hikvision.cms.common.util;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

public class JsonUtils {
    /*  8 */   private static ObjectMapper objectMapper = new ObjectMapper();

    public static String object2Json(Object obj) {
        /* 10 */
        if (obj == null) {
            /* 11 */
            return "";
        }
        /* 13 */
        String result = null;
        try {
            /* 15 */
            result = objectMapper.writeValueAsString(obj);
            /* 16 */
        } catch (IOException e) {
            /* 17 */
            e.printStackTrace();
        }

        /* 20 */
        return result;
    }
}

